package br.com.tcc.systemdx.domain;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;

@Entity
@DiscriminatorValue(ValorGenerico.Tipo.FATOR_RELEVANTE)
public class ValorFatorRelevante extends ValorGenerico {
	/**
	 * 
	 */
	private static final long serialVersionUID = 2987839757779011855L;

	@ManyToMany(cascade= CascadeType.ALL,fetch = FetchType.LAZY)
    @JoinTable(
    		name = "atributovalor", 
    		joinColumns = { @JoinColumn(name = "valorid") },
    		inverseJoinColumns = { @JoinColumn(name = "atributoid") })
    private List<AtributoFatorRelevante> atributos;
	
	@Override
	public String getTipo() {
		return ValorGenerico.Tipo.FATOR_RELEVANTE;
	}
	
	public List<AtributoFatorRelevante> getAtributos() {
		return atributos;
	}
	
	public void setAtributos(List<AtributoFatorRelevante> atributos) {
		this.atributos = atributos;
	}
}
